#include <stdio.h>

#define N 10

int main() {
	int digit_seen[N] = { 0 };
	int digit;
	long n = -1;

	do
	{
		printf("Enter a number: ");
		scanf("%ld", &n);

		if (n <= 0)
		{
			break;
		}

		while (n > 0) {
			digit = n % 10;
			digit_seen[digit] += 1;

			n /= 10;
		}

	} while (1);

	printf("Digit:\t\t");
	for (int i = 0; i < N; i++)
	{
		printf("%d ", i);
	}

	printf("\nOccurrences: \t");
	for (int i = 0; i < N; i++)
	{
		printf("%d ", digit_seen[i]);
	}

	printf("\n");

	return 0;
}